package com.ddpt.platform.common.enums;

/**
 * 用途枚举
 */
public enum PurposeTypeEnum {

    userGroup(0,"客群用"),
    tag(1,"标签用")
    ;

    public final Integer code;

    public final String remark;

    PurposeTypeEnum(Integer code, String...remarks) {
        this.code = code;
        this.remark = remarks.length>0?remarks[0]:"";
    }

    public static PurposeTypeEnum getByType(Integer code){
        if(code == null){
            return tag;
        }
        for (PurposeTypeEnum pe : PurposeTypeEnum.values()) {
            if(pe.code.equals(code)){
                return pe;
            }
        }
        return tag;
    }
}
